function reallocReactGroup(p,n)
  use derived,only:ReactionRateGroup
  implicit none

  type(ReactionRateGroup),pointer,dimension(:) :: &
       reallocReactGroup,p
  integer,intent(in) :: n
  integer :: i,j,nold,ierr

  allocate(reallocReactGroup(1:n),stat=ierr)
  if (ierr.ne.0) call abnormal_stop("reallocReactGroup",&
       "Memory allocation cause an error.")
  if (.not.associated(p)) return

  do i=1,n
     reallocReactGroup(i)%a_count=0
     reallocReactGroup(i)%a_rate=0
  end do

  nold=n-1
  do i=1,nold
     reallocReactGroup(i)%react_type=p(i)%react_type
     reallocReactGroup(i)%target1=p(i)%target1
     reallocReactGroup(i)%target2=p(i)%target2
  end do

  deallocate(p)

  return

end function reallocReactGroup

